<script type="text/javascript" src="${base}/scripts/htgl/xsht_detail.js"></script>
<div id="xsht_tabs" class="easyui-tabs" detail="true" data-options="fit:true,border:false">
<div title="合同信息">
    <table style="width: 100%" class="tb tab-t t-bor">
        <input type="hidden" name="xsht.name.id" id="xsht_id" value="${(xsht.id)!}"/>
        <input type="hidden" name="htdy.xsht.id" id="htdy_id" value="${(htdyId)!''}"/>
        <col width="90px"/>
        <col width=""/>
        <col width="100px"/>
        <col width=""/>
        <col width="90px"/>
        <col width=""/>
        <tr>
            <th>合&nbsp;同&nbsp;&nbsp;号：</th>
            <td colspan="3">
            ${(xsht.htbm)!}
            </td>
        <#--<#if xsht.xslx=='zddh'>-->
            <th style="font-weight: bold">采购合同：</th>
            <td>
                <a href="javascript:void(0)" onclick="viewZddhXsDetail('${(xsht.zddhcght.id)!}')">
                    <span>${(xsht.zddhcght.htbm)!}</span>
                </a>
            </td>
        <#--</#if>-->
        <tr>
            <th>路&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;径：</th>
            <td colspan="5">
            <#if xsht?? && xsht.lj??>
                <span class="ljtip">  ${(xsht.lj.mc)!}   </span>
            </#if>
            </td>
            <input id="xsht_detail_ljtip" value="${(xsht.lj.id)!}" type="hidden"/>
        </tr>
        <tr>
            <th>协&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;议：</th>
            <td>
            <#if xsht?? && xsht.xy??>
                <a href="javascript:void(0);" onclick="viewXshtXyDetail('${(xsht.xy.id)!}','${(xyType)!}')">
                    <span>${(xsht.xy.xyhm)!}</span>
                </a>
            </#if>
            </td>
            <th>合同类型：</th>
            <td>
            <#if xsht??&& xsht.xslx=='kcxs'>库存销售<#else>直达到货</#if>
            </td>

            <th>客&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;户：</th>
            <td>
            ${(xsht.hzf.qc)!}
            </td>
        </tr>
        <tr>
            <th>签订日期：</th>
            <td>
            ${(xsht.qdrq?date)!}
            </td>
            <th>签订地点：</th>
            <td>
            ${(xsht.qddd)!}
            </td>

            <th>回款方式：</th>
            <td>
            ${(xsht.fkfs.z)!}
            </td>
        </tr>
        <tr>
            <th>交货时间：</th>
            <td>
            ${(xsht.jhsj?date)!}
            </td>
            <th>交货地点：</th>
            <td>
            ${(xsht.jhdd)!}
            </td>

            <th>交货方式：</th>
            <td>
            ${(xsht.jhfs)!}
            </td>
        </tr>
        <tr>
            <th>税&nbsp;率(%)：</th>
            <td>
            ${(xsht.sl?string("0.0000"))!}
            </td>
            <th>结束日期：</th>
            <td>
            ${(xsht.jsrq?date)!}
            </td>
            <th>发运责任：</th>
            <td>
            ${(xsht.fhzr.z)!}
            </td>
        </tr>
        <tr>
            <th>工&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;程：</th>
            <td>
            ${(xsht.gc.mc)!}
            </td>
            <th>销售费用：</th>
            <td>
            ${(xsht.xsfy.z)!}
            </td>
            <th>合同性质：</th>
            <td>
            ${(xsht.htxz.z)!}
            </td>
        </tr>
    <#--       <tr>
               <th>回款依据：</th>
               <td>
               ${(xsht.jsyj.z)!}
               </td>
               <th>回款期限：</th>
               <td>
               ${(xsht.hkqx)!}
               </td>
               <th>发运责任：</th>
               <td>
               ${(xsht.fhzr.z)!}
               </td>
           </tr>-->
        <tr>
            <th>申报公司：</th>
            <td>
            ${(xsht.sbgs.jc)!}
            </td>
            <th>申报部门：</th>
            <td>
            ${(xsht.sbbm.qc)!}
            </td>
            <th>申&nbsp;报&nbsp;&nbsp;人：</th>
            <td>
            ${(xsht.sbr.xm)!}
            </td>
        </tr>
        <tr>
            <th>总部销售：</th>
            <td><#if xsht??&&xsht.zbcg>是<#else>否</#if></td>
            <th>销售公司：</th>
            <td colspan="3">
            ${(xsht.wlfgs.qc)!}
            </td>
        <#--<th>销售公司：</th>-->
        <#--<td>-->
        <#--${(xsht.wlfgs.qc)!}-->
        <#--</td>-->
        <#--<th>销售部门：</th>-->
        <#--<td>-->
        <#--${(xsht.wlfbm.qc)!}-->
        <#--</td>-->
        <#--<th>销&nbsp;售&nbsp;&nbsp;员：</th>-->
        <#--<td>-->
        <#--${(xsht.wlfry.xm)!}-->
        <#--</td>-->
        </tr>
        <tr>
            <th>备&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;注：</th>
            <td colspan="5">
            ${(xsht.bz)!}
            </td>
        </tr>
        <tr>
            <th>附&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;件：</th>
            <td class="lian" colspan="5">
            <#if xsht??&&xsht.fjList??>
                <#list xsht.fjList as fj>
                    <span class="uploadify-queue-item fileName" style="height:65px;text-align: center;">
                            <a href="${base}/base/fj/downLoadFj?fjId=${fj.id}" class="previewImg"
                               rel="previewImg_${(xsht.id)!}" title="${(fj.ccmc)!}"
                               style="display:block;margin: 0 auto;">
                                <img src="${base}/base/fj/downLoadFj?fjId=${fj.id}" width="50" height="50"/>
                            </a>
                        <a href="javascript:void(0);"
                           onclick="window.location.href='${base}/base/fj/downLoadFj?fjId=${fj.id}'">下载
                        </a>
                        </span>
                </#list>
            </#if>
            </td>
        </tr>
        <tr>
            <th>制&nbsp;单&nbsp;&nbsp;人：</th>
            <td>${(xsht.createUser.xm)!}</td>
            <th>制单时间：</th>
            <td colspan="3">${(xsht.dateCreated?datetime)!}</td>
        </tr>
    </table>

</div>
<div title="合同明细">
    <div id="xshtmx_detail_toolbar">
        <div class="PTools">
            <ul class="niu">
                <li><a href="javascript:void(0);" name="exp" class="undo" plain="true">导出</a></li>
            </ul>
        </div>
    </div>
    <table id="xsht_xshtmx_table" class="easyui-datagrid" url="${base}/htgl/xshtgl/xshtgl_htmx?xshtId=${(xsht.id)!}"
           rownumbers="true" fit="true" fitColumns="true" showFooter="true" toolbar="#xshtmx_detail_toolbar"
           pagination="true">
        <thead>
        <tr>
            <th data-options="field:'xsxt_xsdh',width:80,align:'right'">销售系统子项号</th>
            <th data-options="field:'wzgg.code',width:50,align:'center'">物资编码</th>
            <th data-options="field:'wzgg.name',width:30,align:'center'">物资名称</th>
            <th data-options="field:'wzgg.ggxh',width:30,align:'center'">规格型号</th>
            <th data-options="field:'wzgg.cz',width:30,align:'center'">材质</th>
            <th data-options="field:'wzgg.dw',width:20,align:'center'">单位</th>
            <th data-options="field:'cd.z',width:20,align:'center'">产地</th>
            <th data-options="field:'sbjs',width:70,align:'right',formatter:formatSlForHtml">件数</th>
            <th data-options="field:'sbsl',width:70,align:'right',formatter:formatSlForHtml">重量</th>
            <th data-options="field:'jzfs.z',width:30,align:'center'">记重方式</th>
            <th data-options="field:'spec',width:50,align:'right'">特点</th>
            <th data-options="field:'hsj',width:70,formatter:formatJeForHtml,align:'right'">含税单价(元)</th>
            <th data-options="field:'bhsj',width:70,formatter:formatJeForHtml,align:'right'">不含税单价(元)</th>
            <th data-options="field:'hsje',width:70,formatter:formatJeForHtml2,align:'right'">含税总金额(元)</th>
        </tr>
        </thead>
    </table>
</div>
<div title="销售记录">
    <table id="xsht_xsd_table" class="easyui-datagrid" url="${base}/xsgl/xsdgl/xsdByXshtList?xshtId=${(xsht.id)!}&sftzd=false"
           rownumbers="true" fit="true" fitColumns="true" pagination="true">
        <thead>
        <tr>
            <th data-options="field:'xsdh',width:50,align:'center'">销售单号</th>
            <th data-options="field:'fhsj',width:30,align:'center'">发货日期</th>
            <th data-options="field:'kh_qc',width:40,align:'center'">客户名称</th>
            <th data-options="field:'gc_mc',width:40,align:'center'">工程名称</th>
            <th data-options="field:'xssl',width:60,align:'right',formatter:formatSlForHtml">销售重量</th>
            <th data-options="field:'xsje',width:60,align:'right',formatter:formatJeForHtml2">销售总金额(元)</th>
            <th data-options="field:'thck_mc',width:40,align:'center'">提货仓库</th>
            <th data-options="field:'fyzr_z',width:25,align:'center'">配送类型</th>
            <th data-options="field:'dsyfje',width:50,formatter:formatJeForHtml2,align:'right'">配送费用</th>
            <th data-options="field:'sbgs_jc',width:40,align:'center'">申报公司</th>
        <#--<th data-options="field:'sbbm_jc',width:40,align:'center'">申报部门</th>-->
            <th data-options="field:'sbr_xm',width:20,align:'center'">申报人</th>
        </tr>
        </thead>
    </table>
</div>
<div title="回款记录">
    <table id="xsht_fkjl_table" class="easyui-datagrid" url="${base}/sfgl/sksh/findskshByXshtList?xshtId=${(xsht.id)!}"
           rownumbers="true" fit="true" fitColumns="true" pagination="true">
        <thead>
        <tr>
            <th data-options="field:'bm',width:40,align:'center'">单据号</th>
            <th data-options="field:'sfklx',width:15,align:'center'">收款类型</th>
            <th data-options="field:'gldw_jc',width:30,align:'center'">关联企业</th>
            <th data-options="field:'sfje',width:50,formatter:formatJeForHtml2,align:'right'">收款总金额(元)</th>
            <th data-options="field:'kxlx',width:15,align:'center'">款项类型</th>
            <th data-options="field:'pjlx_z',width:20,align:'center'">票据类型</th>
            <th data-options="field:'sbgs_jc',width:25,align:'center'">申报公司</th>
            <th data-options="field:'sbr_xm',width:20,align:'center'">申报人</th>
            <th data-options="field:'bz',width:15,align:'center'">备注</th>
        </tr>
        </thead>
    </table>

    </table>
</div>
<div title="选择公式">
    <table id="xsht_gspzList_detail"></table>
</div>
<div title="合同文本" style="overflow:hidden">
    <div id="-toolbar">
        <div class="PTools">
            <ul class="niu">
            <#--<li><span class="xuan">选择合同模板：</span>-->
            <#--<input id="xsht_htmb_id" name="xsht_htmb" type="text" class="searchinput-text">-->
            <#--</li>-->
                <li><a class="she" href="javascript:void(0);" onclick="checkIsInstall('XSHT_')">检查插件</a></li>
                <li><a class="watch" href="javascript:void(0);"
                       onclick="printPreview('XSHT_','${(xshtHtbm)!}','${(xshtEmwtime)!}')">打印</a></li>
            <#--<li><a class="pen" href="javascript:void(0);"-->
            <#--onclick="print('XSHT_','${(xshtHtbm)!}','${(xshtEmwtime)!}')">打印</a></li>-->
            <#--<li><a class="baocun" href="javascript:void(0);" onclick="htwb_save('xsht')">保存合同</a></li>-->
            <#--<li><a class="baocun" href="javascript:void(0);" onclick="htmb_save()">另存为模板</a></li>-->
            </ul>
        </div>
    </div>
    <div style="overflow:auto;height:90%">
        <object id="XSHT_LODOP_OB" classid="clsid:2105C259-1E0C-4534-8141-A753534CB4CA" width=0 height=0>
            <embed id="XSHT_LODOP_EM" type="application/x-print-lodop" width=0 height=0
                   pluginspage="install_lodop32.exe"></embed>
        </object>
        <div id="htwb_xsht_detail_id" class="textcon">

        </div>
    </div>

</div>

<#--<div title="合同文本">-->

<#--<div id="htwb_xsht_detail_id">-->

<#--</div>-->
<#--</div>-->
</div>